<?php

namespace Acme\SecurityBundle;

class SecurityHelper
{
	public function generatePassword($len = 8)
    {
    	$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    	$str = '';
    	for ($i=0; $i < $len; $i++) {
    		$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
    	}
    	return $str;
    }
}